package com.tanhua.manager.controller;

import com.tanhua.manager.service.AnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/dashboard")
public class AnalysisController {
    @Autowired
    private AnalysisService analysisService;

    /**
     * 首页-概要统计信息
     * GET /dashboard/summary
     */
    @GetMapping("/summary")
    public ResponseEntity summary(){
        return analysisService.summary();
    }

    @GetMapping("/users")
    public ResponseEntity usersChartData(Long sd, Long ed, Integer type) {
        return analysisService.usersCharData(sd, ed, type);
    }
}